import com.wyl.pojo.Hello
import org.junit.Test
import org.springframework.context.ApplicationContext
import org.springframework.context.support.ClassPathXmlApplicationContext

class MyTest {
    @Test
    fun test() {
        // 获取Spring上下文对象
        val context: ApplicationContext = ClassPathXmlApplicationContext("beans.xml")
        val bean = context.getBean("hello") as Hello
        println(bean)
    }

    @Test
    fun testAlias() {
        // 获取Spring上下文对象
        val context: ApplicationContext = ClassPathXmlApplicationContext("beans.xml")
        val bean = context.getBean("hello2") as Hello
        println(bean)
    }
}